@extends('admin.admin')

@section('content')
        <!-- Content Header (Page header) -->
<style>
    .color-block{margin-left: 6px;display: inline-block;zoom: 1;width: 14px;height: 14px;border:1px solid #ddd;vertical-align: -3px;}
</style>
<section class="content-header">
    <h1>
        商品管理
        <small>活动专题</small>
        <small>活动添加</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 控制面板</a></li>
        <li ><a href="#">商品管理</a></li>
        <li ><a href="/admin/activity">活动专题</a></li>
        <li class="active">活动添加</li>
    </ol>
</section>

<!-- Main content -->
<section class="content">

    <div class="row">
        <div class="col-xs-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">活动添加</h3>
                    <div class="pull-right">
                        <a href="{{Route('admin.activity.index')}}" type="button" class="btn btn-block btn-success btn-xs"><i class="icon  glyphicon glyphicon glyphicon-menu-left"></i> 返回</a>
                    </div>
                </div>
                <!-- /.box-header -->
                <!-- form start -->
                {!! Form::model($activity,['route'=>'admin.activity.store','class'=>'form-horizontal'])  !!}
                {!! Form::hidden('back_url',@$_SERVER['HTTP_REFERER']) !!}

                <div class="box-body">

                    <div class="nav-tabs-custom">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">基本信息</a></li>
                            <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">页面设置</a></li>
                        </ul>
                        <div class="tab-content clearfix">
                            <div class="tab-pane active" id="tab_1">
                                <div class="form-group @if($errors->has('name')) has-error   @endif">
                                    <label class="col-sm-2 control-label" for="exampleInputEmail1">活动名称</label>
                                    <div class="col-sm-6">
                                        {!! Form::text('name',old('name'),array('class'=>'form-control','placeholder'=>'请填写活动名称'))!!}
                                        @if($errors->has('name'))
                                            <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('name')}}</label>
                                        @endif
                                    </div>
                                </div>

                                <div class="form-group @if($errors->has('identification')) has-error   @endif">
                                    <label class="col-sm-2 control-label" for="exampleInputEmail1">活动页标识</label>
                                    <div class="col-sm-6">
                                        {!! Form::text('identification',old('identification'),array('class'=>'form-control','placeholder'=>'请填写活动页标识'))!!}
                                        @if($errors->has('identification'))
                                            <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('identification')}}</label>
                                        @endif
                                    </div>

                                </div>

                                <div class="form-group @if($errors->has('is_recommend')) has-error   @endif">
                                    <label class="col-sm-2 control-label" for="exampleInputPassword1">是否推荐</label>
                                    <div class="col-sm-2">
                                        {!! Form::select('is_recommend',['0'=>'不推荐','1'=>'推荐'],old('is_recommend'),['class'=>'form-control'])!!}
                                        @if($errors->has('is_recommend'))
                                            <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('is_recommend')}}</label>
                                        @endif
                                    </div>

                                </div>

                                <div class="form-group @if($errors->has('activity_thumb')) has-error   @endif">
                                    <label class="col-sm-2 control-label" for="exampleInputPassword1">活动缩略图</label>

                                    <div class="col-sm-2" style="width: 196px;">
                                        <div class="box  box-default image-uploader">
                                            <style>
                                                .upload-btn{
                                                    display: block; width:48px;height:30px;position: absolute;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;
                                                }
                                            </style>
                                            <!-- /.box-header -->
                                            <div class="box-body">

                                                <div style="width: 145px;height: 145px; display: block;">
                                                    <img class="image" style="width: 145px;; padding: 1px;" width="145" height="145" src="@if (old('image_url')) {{old('image_url')}} @else http://placehold.it/525x240 @endif"/>
                                                    <input type="hidden" class="image_url" name="image_url" value="{{old('image_url')}}">
                                                </div>
                                                <div class="message" style="width: 145px;height: 145px; position: absolute; padding: 5px; top:0; color: red; text-align: center; line-height: 145px;display: none;">

                                                </div>

                                                <div class="progress progress-xxs" style="position: absolute;width: 140px; left:13px; display: none;">
                                                    <div class="progress-bar progress-bar-default " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                                                    </div>
                                                </div>
                                            </div>
                                            <!-- /.box-body -->
                                            <div class="box-footer" style="position: relative">

                                                <button class="btn btn-sm btn-default btn-flat pull-left" type="button">上传</button>
                                                {!! Form::file('file',['class'=>'upload-btn fileupload','type'=>'file','data-url'=>'/admin/file_upload']) !!}
                                                {!! Form::hidden('activity_thumb',old('activity_thumb'),['class'=>'thumb']) !!}

                                                <button class="btn  btn-sm btn-danger btn-flat pull-right" type="button">删除</button>
                                            </div>
                                        </div>
                                        <!-- /.box -->
                                    </div>

                                    @if($errors->has('activity_thumb'))
                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('activity_thumb')}}</label>
                                    @endif
                                </div>

                                <div class="form-group @if($errors->has('m_activity_thumb')) has-error   @endif">
                                    <label class="col-sm-2 control-label" for="exampleInputPassword1">手机端活动缩略图</label>

                                    <div class="col-sm-2" style="width: 196px;">
                                        <div class="box  box-default image-uploader">
                                            <style>
                                                .upload-btn{
                                                    display: block; width:48px;height:30px;position: absolute;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;
                                                }
                                            </style>
                                            <!-- /.box-header -->
                                            <div class="box-body">

                                                <div style="width: 145px;height: 145px; display: block;">
                                                    <img class="image" style="width: 145px;; padding: 1px;" width="145" height="145" src="@if (old('image_url')) {{old('image_url')}} @else http://placehold.it/525x240 @endif"/>
                                                    <input type="hidden" class="image_url" name="image_url" value="{{old('image_url')}}">
                                                </div>
                                                <div class="message" style="width: 145px;height: 145px; position: absolute; padding: 5px; top:0; color: red; text-align: center; line-height: 145px;display: none;">

                                                </div>

                                                <div class="progress progress-xxs" style="position: absolute;width: 140px; left:13px; display: none;">
                                                    <div class="progress-bar progress-bar-default " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                                                    </div>
                                                </div>
                                            </div>
                                            <!-- /.box-body -->
                                            <div class="box-footer" style="position: relative">

                                                <button class="btn btn-sm btn-default btn-flat pull-left" type="button">上传</button>
                                                {!! Form::file('file',['class'=>'upload-btn fileupload','type'=>'file','data-url'=>'/admin/file_upload']) !!}
                                                {!! Form::hidden('m_activity_thumb',old('m_activity_thumb'),['class'=>'thumb']) !!}

                                                <button class="btn  btn-sm btn-danger btn-flat pull-right" type="button">删除</button>
                                            </div>
                                        </div>
                                        <!-- /.box -->
                                    </div>

                                    @if($errors->has('m_activity_thumb'))
                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('m_activity_thumb')}}</label>
                                    @endif
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" for="exampleInputPassword1">描述</label>
                                    <div class="col-sm-6">
                                        {!! Form::textarea('description',old('description'),array('class'=>'form-control','placeholder'=>'请填写描述','rows'=>3))!!}
                                    </div>
                                </div>

                            </div>
                            <!-- /.tab-pane -->
                            <div class="tab-pane clearfix" id="tab_2" style="background: #f1f1f1;padding-top: 20px;">
                                <div class="col-md-6">
                                    <div class="box box-solid">
                                        <div class="box-header with-border">
                                            <h3 class="box-title">背景设置</h3>
                                        </div>
                                        <!-- /.box-header -->
                                        <div class="box-body">
                                            <div class="form-group @if($errors->has('bg_img')) has-error   @endif">
                                                <label class="col-sm-4 control-label" for="exampleInputPassword1">背景图片</label>

                                                <div class="col-sm-4">
                                                    <div class="image-uploader">
                                                        <div class="box-body">

                                                            <div style="width: 145px;height: 145px; display: block;">
                                                                <img class="image" style="width: 145px;; padding: 1px;" width="145" height="145" src="@if (old('bg_img')) {{old('bg_img')}} @else  {{asset('/images/admin/img_placeholder1.png')}} @endif"/>
                                                                <input type="hidden" class="image_url" value="{{old('bg_img')}}">
                                                            </div>
                                                            <div class="message" style="width: 145px;height: 145px; display: block;position: absolute; padding: 5px; top:0px; color: red; text-align: center; line-height: 145px;display: none;">

                                                            </div>

                                                            <div class="progress progress-xxs" style="position: absolute;width: 140px; left:13px; display: none;">
                                                                <div class="progress-bar progress-bar-default " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <!-- /.box-body -->
                                                        <div class="box-footer" style="width: 164px;position: relative">

                                                            <button class="btn btn-sm btn-default btn-flat pull-left" type="button">上传</button>
                                                            {!! Form::file('file',['class'=>'upload-btn fileupload','type'=>'file','data-url'=>'/admin/file_upload']) !!}
                                                            {!! Form::hidden('bg_img',old('bg_img'),['class'=>'thumb']) !!}

                                                            <button class="btn  btn-sm btn-danger btn-flat pull-right" type="button">删除</button>
                                                        </div>
                                                    </div>
                                                    <!-- /.box -->
                                                </div>

                                                <div class="col-sm-4">
                                                    <br>
                                                    <small class="text-muted">宽1920px</small>
                                                    <br>
                                                    <small class="text-muted">高度不限</small>
                                                </div>

                                                @if($errors->has('bg_img'))
                                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('bg_img')}}</label>
                                                @endif
                                            </div>

                                            <div class="form-group @if($errors->has('m_bg_img')) has-error   @endif">
                                                <label class="col-sm-4 control-label" for="exampleInputPassword1">背景图片</label>

                                                <div class="col-sm-4">
                                                    <div class="image-uploader">
                                                        <div class="box-body">

                                                            <div style="width: 145px;height: 145px; display: block;">
                                                                <img class="image" style="width: 145px;; padding: 1px;" width="145" height="145" src="@if (old('m_bg_img')) {{old('m_bg_img')}} @else  {{asset('/images/admin/img_placeholder1.png')}} @endif"/>
                                                                <input type="hidden" class="image_url" value="{{old('m_bg_img')}}">
                                                            </div>
                                                            <div class="message" style="width: 145px;height: 145px; display: block;position: absolute; padding: 5px; top:0px; color: red; text-align: center; line-height: 145px;display: none;">

                                                            </div>

                                                            <div class="progress progress-xxs" style="position: absolute;width: 140px; left:13px; display: none;">
                                                                <div class="progress-bar progress-bar-default " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <!-- /.box-body -->
                                                        <div class="box-footer" style="width: 164px;position: relative">

                                                            <button class="btn btn-sm btn-default btn-flat pull-left" type="button">上传</button>
                                                            {!! Form::file('file',['class'=>'upload-btn fileupload','type'=>'file','data-url'=>'/admin/file_upload']) !!}
                                                            {!! Form::hidden('m_bg_img',old('m_bg_img'),['class'=>'thumb']) !!}

                                                            <button class="btn  btn-sm btn-danger btn-flat pull-right" type="button">删除</button>
                                                        </div>
                                                    </div>
                                                    <!-- /.box -->
                                                </div>

                                                <div class="col-sm-4">
                                                    <br>
                                                    <small class="text-muted">宽1920px</small>
                                                    <br>
                                                    <small class="text-muted">高度不限</small>
                                                </div>

                                                @if($errors->has('m_bg_img'))
                                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('m_bg_img')}}</label>
                                                @endif
                                            </div>

                                            <div class="form-group @if($errors->has('name')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >背景颜色</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('bg_color',old('bg_color'),array('class'=>'form-control','placeholder'=>'背景颜色'))!!}
                                                    @if($errors->has('bg_color'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('bg_color')}}</label>
                                                    @endif
                                                </div>
                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <i class="js-color color-block" style="margin-right: 10px;margin-left: -4px;background-color: {{'#'.$activity->bg_color}};"></i>
                                                    <small class="text-muted">
                                                        默认：0A052D
                                                        <i class="color-block" style="background-color: #0A052D;"></i>
                                                    </small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('name')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >顶部高度</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('bg_margin_top',old('bg_margin_top'),array('class'=>'form-control','placeholder'=>'背景颜色'))!!}
                                                    @if($errors->has('bg_margin_top'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('bg_margin_top')}}</label>
                                                    @endif
                                                </div>
                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：500</small>
                                                </div>
                                            </div>
                                        </div>
                                        <!-- /.box-body -->
                                    </div>


                                    <div class="box box-solid">
                                        <div class="box-header with-border">
                                            <h3 class="box-title">标题设置</h3>
                                        </div>
                                        <!-- /.box-header -->
                                        <div class="box-body">
                                            <div class="form-group @if($errors->has('tit_img')) has-error   @endif">
                                                <label class="col-sm-4 control-label" for="exampleInputPassword1">背景图片</label>

                                                <div class="col-sm-4">
                                                    <div class="image-uploader">
                                                        <div class="box-body">

                                                            <div style="width: 145px;height: 56px; display: block;">
                                                                <img class="image" style="padding: 1px;" width="145" height="56" src="@if (old('tit_img')) {{old('tit_img')}} @else  {{asset('/images/admin/img_placeholder2.png')}} @endif"/>
                                                                <input type="hidden" class="image_url" value="{{old('tit_img')}}">
                                                            </div>
                                                            <div class="message" style="width: 145px;height: 145px; display: block;position: absolute; padding: 5px; top:0px; color: red; text-align: center; line-height: 145px;display: none;">

                                                            </div>

                                                            <div class="progress progress-xxs" style="position: absolute;width: 140px; left:13px; display: none;">
                                                                <div class="progress-bar progress-bar-default " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <!-- /.box-body -->
                                                        <div class="box-footer" style="width:164px;position: relative">

                                                            <button class="btn btn-sm btn-default btn-flat pull-left" type="button">上传</button>
                                                            {!! Form::file('file',['class'=>'upload-btn fileupload','type'=>'file','data-url'=>'/admin/file_upload']) !!}
                                                            {!! Form::hidden('tit_img',old('tit_img'),['class'=>'thumb']) !!}

                                                            <button class="btn  btn-sm btn-danger btn-flat pull-right" type="button">删除</button>
                                                        </div>
                                                    </div>
                                                    <!-- /.box -->
                                                </div>

                                                <div class="col-sm-4">
                                                    <br>
                                                    <small class="text-muted">宽度 < 1050px</small>
                                                    <br>
                                                    <small class="text-muted">高度不限</small>
                                                </div>

                                                @if($errors->has('tit_img'))
                                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tit_img')}}</label>
                                                @endif
                                            </div>

                                            <div class="form-group @if($errors->has('m_tit_img')) has-error   @endif">
                                                <label class="col-sm-4 control-label" for="exampleInputPassword1">背景图片</label>

                                                <div class="col-sm-4">
                                                    <div class="image-uploader">
                                                        <div class="box-body">

                                                            <div style="width: 145px;height: 56px; display: block;">
                                                                <img class="image" style="padding: 1px;" width="145" height="56" src="@if (old('m_tit_img')) {{old('m_tit_img')}} @else  {{asset('/images/admin/img_placeholder2.png')}} @endif"/>
                                                                <input type="hidden" class="image_url" value="{{old('m_tit_img')}}">
                                                            </div>
                                                            <div class="message" style="width: 145px;height: 145px; display: block;position: absolute; padding: 5px; top:0px; color: red; text-align: center; line-height: 145px;display: none;">

                                                            </div>

                                                            <div class="progress progress-xxs" style="position: absolute;width: 140px; left:13px; display: none;">
                                                                <div class="progress-bar progress-bar-default " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <!-- /.box-body -->
                                                        <div class="box-footer" style="width:164px;position: relative">

                                                            <button class="btn btn-sm btn-default btn-flat pull-left" type="button">上传</button>
                                                            {!! Form::file('file',['class'=>'upload-btn fileupload','type'=>'file','data-url'=>'/admin/file_upload']) !!}
                                                            {!! Form::hidden('m_tit_img',old('m_tit_img'),['class'=>'thumb']) !!}

                                                            <button class="btn  btn-sm btn-danger btn-flat pull-right" type="button">删除</button>
                                                        </div>
                                                    </div>
                                                    <!-- /.box -->
                                                </div>

                                                <div class="col-sm-4">
                                                    <br>
                                                    <small class="text-muted">宽度 < 1050px</small>
                                                    <br>
                                                    <small class="text-muted">高度不限</small>
                                                </div>

                                                @if($errors->has('m_tit_img'))
                                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('m_tit_img')}}</label>
                                                @endif
                                            </div>

                                            <div class="form-group @if($errors->has('tit_width')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >宽</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('tit_width',old('tit_width'),array('class'=>'form-control','placeholder'=>'宽'))!!}
                                                    @if($errors->has('tit_width'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tit_width')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：1050</small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('tit_height')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >高</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('tit_height',old('tit_height'),array('class'=>'form-control','placeholder'=>'高'))!!}
                                                    @if($errors->has('tit_height'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tit_height')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：空</small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('tit_line_height')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >行高</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('tit_line_height',old('tit_line_height'),array('class'=>'form-control','placeholder'=>'行高'))!!}
                                                    @if($errors->has('tit_line_height'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tit_line_height')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：37</small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('tit_font_size')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >字号</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('tit_font_size',old('tit_font_size'),array('class'=>'form-control','placeholder'=>'字号'))!!}
                                                    @if($errors->has('tit_font_size'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tit_font_size')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：28</small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('tit_font_color')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >字体颜色</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('tit_font_color',old('tit_font_color'),array('class'=>'form-control','placeholder'=>'字体颜色'))!!}
                                                    @if($errors->has('tit_font_color'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tit_font_color')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <i class="js-color color-block" style="margin-right: 10px;margin-left: -4px;background-color: {{'#'.$activity->tit_font_color}};"></i>
                                                    <small class="text-muted">默认：FFFFFF <i class="color-block" style="background-color: #FFFFFF;"></i></small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('tit_position')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >对齐</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('tit_position',old('tit_position'),array('class'=>'form-control','placeholder'=>'对齐'))!!}
                                                    @if($errors->has('tit_position'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tit_position')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：空</small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- /.box -->


                                </div>


                                <div class="col-md-6">

                                    <div class="box box-solid">
                                        <div class="box-header with-border">
                                            <h3 class="box-title">导航设置</h3>
                                        </div>
                                        <!-- /.box-header -->
                                        <div class="box-body">

                                            <div class="form-group @if($errors->has('sidebar_bg_color')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >背景颜色</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('sidebar_bg_color',old('sidebar_bg_color'),array('class'=>'form-control','placeholder'=>'背景颜色'))!!}
                                                    @if($errors->has('sidebar_bg_color'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('sidebar_bg_color')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <i class="js-color color-block" style="margin-right: 10px;margin-left: -4px;background-color: {{'#'.$activity->sidebar_bg_color}};"></i>
                                                    <small class="text-muted">默认：D53650 <i class="color-block" style="background-color: #D53650;"></i></small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('sidebar_hover_color')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >鼠标悬停颜色</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('sidebar_hover_color',old('sidebar_hover_color'),array('class'=>'form-control','placeholder'=>'鼠标悬停颜色'))!!}
                                                    @if($errors->has('sidebar_hover_color'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('sidebar_hover_color')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <i class="js-color color-block" style="margin-right: 10px;margin-left: -4px;background-color: {{'#'.$activity->sidebar_hover_color}};"></i>
                                                    <small class="text-muted">默认：BC2A68 <i class="color-block" style="background-color: #BC2A68;"></i></small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('sidebar_top')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >距离顶部高度</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('sidebar_top',old('sidebar_top'),array('class'=>'form-control','placeholder'=>'距离顶部高度'))!!}
                                                    @if($errors->has('sidebar_top'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('sidebar_top')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：650</small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('sidebar_left')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >距离左侧宽度</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('sidebar_left',old('sidebar_left'),array('class'=>'form-control','placeholder'=>'距离左侧宽度'))!!}
                                                    @if($errors->has('sidebar_left'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('sidebar_left')}}</label>
                                                    @endif
                                                </div>


                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：550</small>
                                                </div>
                                            </div>
                                            <div class="form-group @if($errors->has('tit_line_height')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >行高</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('sidebar_line_height',old('sidebar_line_height'),array('class'=>'form-control','placeholder'=>'行高'))!!}
                                                    @if($errors->has('sidebar_line_height'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('sidebar_line_height')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：18</small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('sidebar_font_size')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >字号</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('sidebar_font_size',old('sidebar_font_size'),array('class'=>'form-control','placeholder'=>'字号'))!!}
                                                    @if($errors->has('sidebar_font_size'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('sidebar_font_size')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <small class="text-muted">默认：14</small>
                                                </div>
                                            </div>

                                            <div class="form-group @if($errors->has('sidebar_font_color')) has-error   @endif">
                                                <label class="col-sm-4 control-label" >字体颜色</label>
                                                <div class="col-sm-4">
                                                    {!! Form::text('sidebar_font_color',old('sidebar_font_color'),array('class'=>'form-control','placeholder'=>'字体颜色'))!!}
                                                    @if($errors->has('sidebar_font_color'))
                                                        <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('sidebar_font_color')}}</label>
                                                    @endif
                                                </div>

                                                <div class="col-sm-4" style="margin-top: 5px;margin-left:-20px;">
                                                    <i class="js-color color-block" style="margin-right: 10px;margin-left: -4px;background-color: {{'#'.$activity->sidebar_font_color}};"></i>
                                                    <small class="text-muted">默认：FFFFFF <i class="color-block" style="background-color: #FFF;"></i></small>
                                                </div>
                                            </div>

                                        </div>

                                    </div>


                                    <div class="box box-solid">
                                        <div class="box-header with-border">
                                            <h3 class="box-title"><i class="fa fa-bullhorn"></i>设置须知</h3>
                                        </div>
                                        <!-- /.box-header -->
                                        <div class="box-body">
                                            <ol>
                                                <li>本栏目所有选项都可为空，未赋值时使用网站默认样式；</li>
                                                <li>本版本暂不支持预览功能，请保存后到前台查看；</li>
                                                <li>宽、高、行高、字号、间距 请填写数字；</li>
                                                <li>颜色值请填写完整的16进制色值，例如：FFFFFF、000000、333333</li>
                                            </ol>
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <!-- /.tab-pane -->
                        </div>
                    </div>
                </div>
                <div class="box-footer">
                    <div class="form-group no-padding">
                        <label class="col-sm-2 control-label">&nbsp;</label>
                        <div class="col-sm-4">
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </div>
                </div>

                {!! Form::close()  !!}
            </div>
            <!-- /.box -->
        </div>
    </div>

</section>
<!-- /.content -->

<script src="{{ asset ("/components/blueimp-file-upload/js/vendor/jquery.ui.widget.js") }}"></script>
<script src="{{ asset ("/components/blueimp-file-upload/js/jquery.iframe-transport.js") }}"></script>
<script src="{{ asset ("/components/blueimp-file-upload/js/jquery.fileupload.js") }}"></script>
<script>
    $(function () {
        $('.image-uploader').each(function(k,imageUploader){
            var wrapper = $(imageUploader);//盒子
            var uploadBtn = wrapper.find('.fileupload');
            var imageFile = wrapper.find('.image');
            var progress = wrapper.find('.progress');
            var progressBar = progress.find('.progress-bar');
            var inputFile = wrapper.find('.thumb');
            var imageUrl = wrapper.find('.image_url');
            var message = wrapper.find('.message');

            var placeholder='';
            if(k==0){
                placeholder='http://placehold.it/525x240';
            }else if(k==1){
                placeholder='{{asset('/images/admin/img_placeholder1.png')}}';
            }else if(k==2){
                placeholder='{{asset('/images/admin/img_placeholder2.png')}}';
            }

            uploadBtn.click(function(){
                progressBar.css('width', 0 + '%');
                //imageFile.attr('src','http://placehold.it/525x240');
                inputFile.val('');
                message.hide();

            });
            wrapper.find('.btn-danger').click(function(){
                progressBar.css('width', 0 + '%');
                //imageFile.attr('src','http://placehold.it/525x240');
                imageFile.attr('src',placeholder);
                inputFile.val('');
                message.hide();

            });

            uploadBtn.fileupload({
                dataType: 'json',
                headers:{'X-CSRF-TOKEN':'{{csrf_token()}}'},
                add: function (e, data) {
                    data.submit();
                },
                progressall: function (e, data) {
                    progress.fadeIn();
                    var percent = parseInt(data.loaded / data.total * 100, 10);
                    if (progress==1){
                        progress.show()
                    }
                    progressBar.css('width', percent + '%');
                    setTimeout(function () {
                        progress.fadeOut();
                    }, 500);
                },
                done: function (e, data) {
                    imageFile.attr('src',data.result.url);
                    inputFile.val(data.result.id);
                    imageUrl.val(data.result.url);
                },
                complete:function(){
                }
            });
        });

        //修改色块
        $('.js-color').each(function(){
            var that=$(this),input=that.closest('.form-group').find('input');
            input.on('change input',function(){
                that.css('background-color','#'+$(this).val());
            });
        });
    });
</script>
@endsection